﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace SideMan.Models
{
    public class ColorGenerator
    {
        // FFFFFF 
        // 9DBDC6
        // FF3D2E
        // DAEAEF
        // 272F32
        private static readonly Random random = new Random();
        private static readonly Color[] colors = new Color[]
        {
            Color.FromRgb(0xFF, 0xFF, 0xFF),
            Color.FromRgb(0x9D, 0xBD, 0xC6),
            Color.FromRgb(0xFF, 0x3D, 0x2E),
            Color.FromRgb(0xDA, 0xEA, 0xEF),
            Color.FromRgb(0x27, 0x2F, 0x32),
        };
        private static int oldIndex = 0;
        private static int getNext()
        {
            int rt = oldIndex;
            do
            {
                rt = random.Next(0, colors.Length);
            }
            while(oldIndex == rt);

            oldIndex = rt;
            return rt;
        }
        public static Color GenerateRandomColor()
        {
            var idx = getNext();

            return colors[idx];
        }
    }
}
